unit uFunc;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls, Grids, DBGrids, SynEditHighlighter,
  SynHighlighterSQL, SynEdit, SynDBEdit, DB, DBClient, ExtCtrls, MemDS,
  DBAccess, Uni;

type
  TFuncoes = class
    class procedure CarregarDataSet( CDS : TClientDataSet);
    class procedure SalvarDataSet ( CDS : TClientDataSet);
  end;

implementation

{ TFuncoes }

class procedure TFuncoes.CarregarDataSet(CDS: TClientDataSet);
var Caminho : string;
begin
  Caminho := ExtractFilePath(ParamStr(0));
  if FileExists(Caminho +  CDS.Name + '.cds') then
    CDS.LoadFromFile(Caminho +  CDS.Name + '.cds');
end;

class procedure TFuncoes.SalvarDataSet(CDS: TClientDataSet);
var Caminho : string;
begin
  Caminho := ExtractFilePath(ParamStr(0));
  cds.SaveToFile(Caminho + CDS.Name + '.cds',dfBinary);
end;

end.
